package models;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @author luong
 * this entity is mapped to the Mot table
 */
@Entity 
@Table (name="Mot")
public class HibernateWord implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id @GeneratedValue
	@Column (name = "WORD_ID")
	private int word_id;
	
	@Column
	private String mot;
	
	@OneToMany (cascade = CascadeType.REFRESH)
	@JoinColumn(name="ELEM_OCC")
	private Set<HibernateOccurence> occList;
	
	@OneToMany (cascade = CascadeType.REFRESH)
	@JoinColumn(name="ELEM_POS")
	private Set<HibernatePosition> positionList;

	public HibernateWord() {}

	public int getId() {
		return word_id;
	}

	public void setId(int id) {
		this.word_id = id;
	}

	public String getMot() {
		return mot;
	}

	public void setMot(String word) {
		this.mot = word;
	}

	public Set<HibernateOccurence> getOccList() {
		return occList;
	}

	public void setOccList(Set<HibernateOccurence> occList) {
		this.occList = occList;
	}

	public Set<HibernatePosition> getPositionList() {
		return positionList;
	}

	public void setPositionList(Set<HibernatePosition> positionList) {
		this.positionList = positionList;
	}
	
	
	

}
